{extend name="base" /}
<!-- page specific plugin styles -->
{block name="inline-styles"}
{/block}
<!-- PAGE CONTENT BEGINS -->
{block name="content"}
<div class="page js_show">
    <div class="page__bd" style="height: 100%">
        <div class="weui-tab">
            <div class="weui-navbar">
                <a class="weui-navbar__item" href="{:url('Index/achievement_alone')}">
                    个人业绩
                </a>
                <a class="weui-navbar__item weui-bar__item_on" href="{:url('Index/achievement_team')}">
                    团队业绩
                </a>
            </div>
            <div class="weui-tab__panel" id="ajaxForm">

                <div class="weui-panel">
                    <div class="weui-panel__bd">
                        <div class="weui-media-box weui-media-box_text" style="text-align: center;">
                            <div class="weui-wepay-color-lightblue"><input type="text" id='dataTime' value="{$date}"  style="width: 70px;border:0;color: #1c7efb" /> <i class="fa fa-angle-down"></i></div>
                            <h4 class="weui-media-box__title">当日业绩（件）</h4>
                            <p class="weui-media-box__desc" id="oneday">100</p>
                        </div>
                    </div>
                    <div class="weui-panel__ft weui-cells">
                        <div class="weui-panel__bd">
                            <div class="weui-flex">
                                <div class="weui-navbar__item">
                                    <div class="weui-media-box weui-media-box_text">
                                        <h4 class="weui-media-box__title" id="benyue">10000</h4>
                                        <p class="weui-media-box__desc"> 本月业绩（件）</p>
                                    </div>
                                </div>
                                <div class="weui-navbar__item">
                                    <div class="weui-media-box weui-media-box_text">
                                        <h4 class="weui-media-box__title" id="shangyue">10000</h4>
                                        <p class="weui-media-box__desc">上月业绩（件）</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="weui-cells" style="display: none">
                    <div class="weui-cell weui-cell_access">
                        <div class="weui-cell__hd">
                            <img src="/static/weui-extension/dist/example/images/list_eg_img_1.jpg" alt="" width="34" height="34">
                        </div>
                        <div class="weui-cell__bd">
                            <div class="weui-cell__title">聚会AA</div>
                        </div>
                        <div class="weui-cell__ft">
                            <div class="weui-wepay-color-orange">+100.00</div>
                        </div>
                    </div>
                    <div class="weui-cell weui-cell_access">
                        <div class="weui-cell__hd">
                            <img src="/static/weui-extension/dist/example/images/list_eg_img_1.jpg" alt="" width="34" height="34">
                        </div>
                        <div class="weui-cell__bd">
                            <div class="weui-cell__title">聚会AA</div>
                        </div>
                        <div class="weui-cell__ft">
                            <div class="weui-wepay-color-orange">+100.00</div>
                        </div>
                    </div>
                    <div class="weui-cell weui-cell_access">
                        <div class="weui-cell__hd">
                            <img src="/static/weui-extension/dist/example/images/list_eg_img_1.jpg" alt="" width="34" height="34">
                        </div>
                        <div class="weui-cell__bd">
                            <div class="weui-cell__title">聚会AA</div>
                        </div>
                        <div class="weui-cell__ft">
                            <div class="weui-wepay-color-orange">+100.00</div>
                        </div>
                    </div>
                    <div class="weui-cell weui-cell_access">
                        <div class="weui-cell__hd">
                            <img src="/static/weui-extension/dist/example/images/list_eg_img_1.jpg" alt="" width="34" height="34">
                        </div>
                        <div class="weui-cell__bd">
                            <div class="weui-cell__title">聚会AA</div>
                        </div>
                        <div class="weui-cell__ft">
                            <div class="weui-wepay-color-orange">+100.00</div>
                        </div>
                    </div>
                </div>

            </div>
            <div class="weui-tabbar">
                <a href="{:url('Index/home')}" class="weui-tabbar__item weui-bar__item_on">
                    <div class="weui-tabbar__icon">
                        <i class="fa fa-home"></i>
                    </div>
                    <p class="weui-tabbar__label">主页</p>
                </a>
                <a href="{:url('Index/goods')}" class="weui-tabbar__item">
                    <div class="weui-tabbar__icon">
                        <i class="fa fa-list"></i>
                    </div>
                    <p class="weui-tabbar__label">下单</p>
                </a>
            </div>
        </div>
    </div>
</div>
{/block}
<!-- PAGE CONTENT ENDS -->
<!-- inline scripts related to this page -->
{block name="related-scripts"}
<script type="text/javascript">
    query();
    function query(){
        $.ajax({
            url: '/api/v1/team/yejiteam',
            type: 'POST',
            dataType: 'json',
            data:{
                date:$("#dataTime").val()
            }
        })
        .done(function(json) {
            console.log("success");
            initPageHTML("ajaxForm",json.data);
            renderData("#listData",json.data.list);
        })
        .fail(function() {
            console.log("error");
        })
        .always(function() {
            console.log("complete");
        });
    }

    // 渲染列表
    function renderData(_elment,_data){
        $(_elment).empty();
        for(var i= 0; i<_data.length;i++){
            var _item =
            '<div class="weui-cell weui-cell_access">\
                <div class="weui-cell__hd">\
                    <img src="'+_data[i].avatar+'" alt="" width="34" height="34">\
                </div>\
                <div class="weui-cell__bd">\
                    <div class="weui-cell__title">'+_data[i].name+'</div>\
                </div>\
                <div class="weui-cell__ft">\
                    <div class="weui-wepay-color-orange">+'+_data[i].money+'</div>\
                </div>\
            </div>';

            $(_elment).append(_item);
        }

    }

    $("#dataTime").calendar({
        onChange: function (p, values, displayValues) {
          console.log(values, displayValues);
          $("#dataTime").val(values[0])
          query()
        }
    });
//重置浏览器回退链接
browserBack("home.html");
</script>
{/block}